#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileDialog>
#include <QMessageBox>
#include <QDebug>
#include <QProcess>
#include <QTranslator>
#include <QSettings>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_pushButton_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_2_clicked();

    void on_checkBox_stateChanged(int arg1);

    void on_pushButton_4_clicked();

    void on_pushButton_5_clicked();

    void on_textEdit_ReceiveMsg_textChanged();

    void on_switchLanguageButton_clicked();

private:
    int lzmaProcess(int numArgs, const char *args[], char *rs);
    void switchLanguage();
    void retranslateUi();
    QString tr2(const QString& textCN, const QString& textEN);
    
    Ui::MainWindow *ui;
    QByteArray oldFile;
    QByteArray newFile;
    bool headFlag;
    bool isChineseLanguage; // 标记当前语言，true为中文，false为英文
    QTranslator translator; // 翻译器
};
#endif // MAINWINDOW_H
